<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .app{
            width: 600px;
            height: 600px;
            background: pink;
            margin: 0 auto;
        }
        .app > div{
            height: 80px;
            border: 1px solid #000;
        }
        .app > button{
            width: 66px;
            height: 66px;
            display: block;
            border: 1px solid #000;
        }
        .asdd{
            width: 180px;
            height: 80px;
            background: red;
        }
    </style>
</head>
<body>
    <div class="app">
        <div>{{name}}</div>
        <hell class="asdd" @click="change" :a="age"></hell>
        <button>变换</button>
    </div>
    <template id="asd">
        <div>
            <h1>阿松大{{a}}</h1>
            <button v-bind="$attrs">这是子按钮</button>
        </div>
        <h1 v-bind="$attrs">第二个根节点{{name}}</h1>
    </template>
</body>
</html>
<script>
    const app = Vue.createApp({
        data(){
            return{
                name:'ming',
                age:19,
                axr:'男'
            }
        },
        methods: {
            change(){
                console.log('123');
            }
        },
        components:{
            hell:{
                template:'#asd',
                inheritAttrs:false,
                props:['a'],
                data(){
                    return{
                        name:'hong'
                    }
                }
            },
            
        }
    })
    app.mount('.app')
</script>